package com.example.diarymanger.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@Getter
@Setter
@TableName("diary")
public class DiaryBean {

    @TableId(type = IdType.AUTO) // 指定为主键，并使用数据库ID自增策略
    private Integer id;

    @TableField("diary_id")
    private Integer diaryId;

    @TableField("name")
    private String name;

    @TableField("uid")
    private Integer uid;

    @TableField("diary_title")
    private String diaryTitle;

    @TableField("date")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private Date date;

    @TableField("mood")
    private String mood;

    @TableField("diary_content")
    private String diaryContent;

    @TableField("Image_link")
    private String imageLink;

    @TableField("Is_public")
    private Boolean isPublic;

    @TableField("like_count")
    private Integer likeCount;

}
